﻿<UserControl x:Class="Microsoft.Samples.Kinect.KinectFusionExplorer.ReconstructionSensorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:tk="clr-namespace:Microsoft.Kinect.Toolkit;assembly=Microsoft.Kinect.Toolkit"
             xmlns:l="clr-namespace:Microsoft.Samples.Kinect.KinectFusionExplorer"
             mc:Ignorable="d" 
             d:DesignHeight="215" d:DesignWidth="580" 
             DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <UserControl.Resources>
        <SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e"/>
        <SolidColorBrush x:Key="KinectBlueBrush" Color="#ff00BCF2"/>
        <SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f"/>

        <l:DepthToTextConverter x:Key="dtt"/>
        <l:FloatValueToIntTextConverter x:Key="fvtt"/>

        <Style TargetType="{x:Type RadioButton}" x:Key="KinectRadioButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <StackPanel Orientation="Horizontal" Background="Transparent">
                            <Grid x:Name="RadioButtonChecked">
                                <Image x:Name="CheckedNormal" Source="Images\RadioCheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
                                <Image x:Name="CheckedHover" Source="Images\RadioCheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
                            </Grid>
                            <Grid x:Name="RadioButtonUnchecked" Visibility="Collapsed">
                                <Image x:Name="UncheckedNormal" Source="Images\RadioUncheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
                                <Image x:Name="UncheckedHover" Source="Images\RadioUncheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
                            </Grid>
                            <TextBlock x:Name="RadioButtonText" Text="{TemplateBinding Content}" TextAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource KinectPurpleBrush}" FontSize="15" Margin="5 0 0 0"/>
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter Property="Visibility" Value="Collapsed" TargetName="RadioButtonChecked"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="RadioButtonUnchecked"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Visibility" Value="Collapsed" TargetName="CheckedNormal"/>
                                <Setter Property="Visibility" Value="Collapsed" TargetName="UncheckedNormal"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="CheckedHover"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="UncheckedHover"/>
                                <Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}" TargetName="RadioButtonText"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type CheckBox}" x:Key="KinectCheckBox">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CheckBox}">
                        <Grid>
                            <StackPanel Orientation="Horizontal" Background="Transparent">
                                <Grid x:Name="CheckBoxChecked">
                                    <Image x:Name="CheckedNormal" Source="Images\CheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
                                    <Image x:Name="CheckedHover" Source="Images\CheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
                                </Grid>
                                <Grid x:Name="CheckBoxUnchecked" Visibility="Collapsed">
                                    <Image x:Name="UncheckedNormal" Source="Images\UncheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
                                    <Image x:Name="UncheckedHover" Source="Images\UncheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
                                </Grid>
                                <TextBlock x:Name="CheckBoxText" Text="{TemplateBinding Content}" TextAlignment="Left"  VerticalAlignment="Center" Foreground="{StaticResource KinectPurpleBrush}" FontSize="15"  Margin="9,0,0,0"/>
                            </StackPanel>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter Property="Visibility" Value="Collapsed" TargetName="CheckBoxChecked"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="CheckBoxUnchecked"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Visibility" Value="Collapsed" TargetName="CheckedNormal"/>
                                <Setter Property="Visibility" Value="Collapsed" TargetName="UncheckedNormal"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="CheckedHover"/>
                                <Setter Property="Visibility" Value="Visible" TargetName="UncheckedHover"/>
                                <Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}" TargetName="CheckBoxText"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="Transparent"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="22"/>
            <Setter Property="Width" Value="11"/>
            <Setter Property="Foreground" Value="{StaticResource KinectPurpleBrush}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Border x:Name="Body" Width="11" Height="22" Background="{TemplateBinding Foreground}"/>
                        </Canvas>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="KinectSlider" TargetType="{x:Type Slider}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="{StaticResource KinectPurpleBrush}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Slider}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <TickBar x:Name="Tick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Top" Grid.Row="0" Visibility="Visible"/>
                                <Border x:Name="TrackBackground" Background="{TemplateBinding Foreground}" CornerRadius="1" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
                                    <Canvas Margin="-6,-1">
                                        <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden"/>
                                    </Canvas>
                                </Border>
                                <Track x:Name="PART_Track" Grid.Row="1">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}"/>
                                    </Track.Thumb>
                                </Track>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}" TargetName="Thumb"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="KinectTextFormat" TargetType="{x:Type TextBlock}">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="15"/>
        </Style>

        <Style x:Key="KinectTextFormatTextBox" TargetType="{x:Type TextBox}">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="12"/>
        </Style>
    </UserControl.Resources>

    <Border Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"  BorderBrush="{StaticResource KinectPurpleBrush}" BorderThickness="2">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="44"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <StackPanel Grid.ColumnSpan="4" Background="{StaticResource KinectPurpleBrush}" Margin="-1,-1,0,0">
                <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="White">Image Options</TextBlock>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4">
                <CheckBox Style="{StaticResource KinectCheckBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10" Content="Use Camera" IsChecked="{Binding UseSensor}" AutomationProperties.AutomationId="UseSensor"/>
                <CheckBox Style="{StaticResource KinectCheckBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10" Name="checkBoxNearMode" Content="Near Mode" IsChecked="{Binding NearMode}" AutomationProperties.AutomationId="NearMode"/>
                <CheckBox Style="{StaticResource KinectCheckBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10" Content="Mirror Depth" IsChecked="{Binding MirrorDepth}" AutomationProperties.AutomationId="MirrorDepth" />
                <CheckBox Style="{StaticResource KinectCheckBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10" Content="Capture Color" IsChecked="{Binding CaptureColor}" AutomationProperties.AutomationId="CaptureColor" />
            </StackPanel>

            <Border Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"  BorderBrush="{StaticResource KinectPurpleBrush}" BorderThickness="2">

                <Grid Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Background="{StaticResource KinectPurpleBrush}" Margin="-1 0 -1 0" Height="20" VerticalAlignment="Top">
                        <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="White">Depth Threshold</TextBlock>
                    </StackPanel>

                    <StackPanel Grid.Row="1" VerticalAlignment="Top">
                        <Grid Margin="0 10 0 0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Min</TextBlock>
                            <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="0.02" LargeChange="1.5" Value="{Binding MinDepthClip}" Minimum="0.35" Maximum="8.0" Ticks="0.35, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0" Margin="5" AutomationProperties.AutomationId="MinDepthClip"/>
                            <StackPanel Orientation="Horizontal" Grid.Column="2" Margin="0 0 0 0">
                                <TextBox Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="35" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 0 0">
                                    <TextBox.Text>
                                        <Binding Path="MinDepthClip" Converter="{StaticResource dtt}">
                                            <Binding.ConverterParameter>
                                                <x:ArrayExtension Type="{x:Type sys:Double}">
                                                    <sys:Double>0.35</sys:Double>
                                                    <sys:Double>8.0</sys:Double>
                                                </x:ArrayExtension>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </TextBox.Text>
                                </TextBox>                    
                                <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="2 0 3 0" Text="m"/>
                            </StackPanel>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Max</TextBlock>
                            <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="0.02" LargeChange="1.5" Value="{Binding MaxDepthClip}" Minimum="0.35" Maximum="8.0" Ticks="0.35, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0" Margin="5" AutomationProperties.AutomationId="MaxDepthClip"/>
                            <StackPanel Orientation="Horizontal" Grid.Column="2" Margin="0 0 0 0">
                                <TextBox Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="35" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 0 0">
                                    <TextBox.Text>
                                        <Binding Path="MaxDepthClip" Converter="{StaticResource dtt}">
                                            <Binding.ConverterParameter>
                                                <x:ArrayExtension Type="{x:Type sys:Double}">
                                                    <sys:Double>0.35</sys:Double>
                                                    <sys:Double>8.0</sys:Double>
                                                </x:ArrayExtension>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </TextBox.Text>
                                </TextBox>
                                
                                <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="2 0 3 0" Text="m"/>
                            </StackPanel>
                        </Grid>
                    </StackPanel>

                    <Button Grid.Row="2" Margin="10 5 10 5" Background="{StaticResource KinectPurpleBrush}" BorderBrush="White" BorderThickness="2" Content="Reset All To Defaults" Height="30" Click="ResetCameraDefaultsButtonClick" Width="140" Foreground="White" Focusable="False"/>

                </Grid>
            </Border>


            <Border Grid.Row="2" Grid.Column="0" Grid.RowSpan="3" Grid.ColumnSpan="2"  BorderBrush="{StaticResource KinectPurpleBrush}" BorderThickness="2">
                <Grid Margin="0 0 0 0" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="4" Background="{StaticResource KinectPurpleBrush}" Margin="-1 0 -1 0">
                        <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="White">Camera Pose</TextBlock>
                    </StackPanel>

                    <Grid Grid.Row="1" Margin="0 0 0 -5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Rot X</TextBlock>
                        <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="1.0" LargeChange="45.0" Value="{Binding AngleX}" Minimum="-180.0" Maximum="180.0" Ticks="-135.0, -90.0, -45.0, 0.0, 45.0, 90.0, 135.0, 180.0" Margin="5" AutomationProperties.AutomationId="AngleX"/>
                        <TextBox Grid.Column="2" Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="43" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 5 0" Text="{Binding AngleX, Converter={StaticResource fvtt}}"/>
                    </Grid>

                    <Grid Grid.Row="2" Margin="0 0 0 -5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Rot Y</TextBlock>
                        <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="1.0" LargeChange="45.0" Value="{Binding AngleY}" Minimum="-180.0" Maximum="180.0" Ticks="-135.0, -90.0, -45.0, 0.0, 45.0, 90.0, 135.0, 180.0" Margin="5" AutomationProperties.AutomationId="AngleY"/>
                        <TextBox Grid.Column="2" Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="43" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 5 0" Text="{Binding AngleY, Converter={StaticResource fvtt}}"/>
                    </Grid>

                    <Grid Grid.Row="3" Margin="0 0 0 -5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Rot Z</TextBlock>
                        <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="1.0" LargeChange="45.0" Value="{Binding AngleZ}" Minimum="-180.0" Maximum="180.0" Ticks="-135.0, -90.0, -45.0, 0.0, 45.0, 90.0, 135.0, 180.0" Margin="5" AutomationProperties.AutomationId="AngleZ"/>
                        <TextBox Grid.Column="2" Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="43" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 5 0" Text="{Binding AngleZ, Converter={StaticResource fvtt}}"/>
                    </Grid>

                    <Grid Grid.Row="4" Margin="0 0 0 0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="5 0 0 0">Distance</TextBlock>
                        <Slider Grid.Column="1" Style="{StaticResource KinectSlider}" SmallChange="0.1" LargeChange="0.5" Value="{Binding AxisDistance}" Minimum="0.0" Maximum="6.0" Ticks="0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0" Margin="5" AutomationProperties.AutomationId="AxisDistance"/>
                        <StackPanel Orientation="Horizontal" Grid.Column="2" Margin="0 0 0 0">
                            <TextBox Style="{StaticResource KinectTextFormatTextBox}" TextWrapping="NoWrap" Width="35" HorizontalContentAlignment="Right" Foreground="{StaticResource KinectPurpleBrush}" Margin="0 0 0 0">
                                <TextBox.Text>
                                    <Binding Path="AxisDistance" Converter="{StaticResource dtt}">
                                        <Binding.ConverterParameter>
                                            <x:ArrayExtension Type="{x:Type sys:Double}">
                                                <sys:Double>0.0</sys:Double>
                                                <sys:Double>6.0</sys:Double>
                                            </x:ArrayExtension>
                                        </Binding.ConverterParameter>
                                    </Binding>
                                </TextBox.Text>
                            </TextBox>
                            <TextBlock Style="{StaticResource KinectTextFormat}" Foreground="{StaticResource KinectPurpleBrush}" Margin="2 0 3 0" Text="m"/>
                        </StackPanel>
                    </Grid>

                </Grid>
            </Border>



        </Grid>
    </Border>
</UserControl>
